package com.alibaba.cloud.authorization.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class AuthPageController {

    private static final Logger LOGGER = LoggerFactory.getLogger(AuthPageController.class);

    @RequestMapping("/thirdLogin")
    public ModelAndView login() {
        // 获取跳转到授权页面的参数
        ModelAndView mv = new ModelAndView();
        mv.addObject("responseType", "code");
        mv.addObject("clientId", "ali_client");
        mv.addObject("redirectUri", "http://localhost:9092/base/oauth/callback");
        mv.addObject("scope", "customer");
        mv.addObject("state", "xyz123abc");
        mv.setViewName("login");
        return mv;
    }

    @RequestMapping("/authorization")
    public String authorizationPage() {

        return "authorization";
    }

}
